package com.chinaoly.myapplication;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.RecyclerView;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseViewHolder;
import com.chen.glide_ex.Base64tUtil;
import com.chen.helper.LightRecycleViewHelper;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by chenjian on 2019/4/2 11:10.
 */
public class TActivity extends AppCompatActivity {

    LightRecycleViewHelper<String> helper;
    RecyclerView rv;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_common_recy);
        rv = findViewById(R.id.rv);
        helper = new LightRecycleViewHelper<String>(R.layout.item_image, rv) {
            @Override
            protected void setItemData(BaseViewHolder helper, String item) {
                Base64tUtil.LoadImageFromBase64((ImageView) helper.getView(R.id.iv), item);


            }
        };
        List<String> s = new ArrayList<>();
        for (int i = 0; i < 100; i++) {
            s.add(Base64Constant.pic);
        }
        helper.setListData(s);
    }
}
